Public Class Server
    Inherits ObjectBase

    Private msName As String
    Private msDesc As String

    Private mbIsActive As Boolean

    Private mbScanForSchemaChanges As Boolean = True

    Public Sub New()
        MyBase.New()
    End Sub

    Public Sub New( _
                ByVal lID As Long)

        MyBase.New(lID)
    End Sub

#Region "Properties"
    Public Property Name() As String
        Get
            Return msName
        End Get
        Set(ByVal value As String)
            msName = value
        End Set
    End Property

    Public Property Desc() As String
        Get
            Return msDesc
        End Get
        Set(ByVal value As String)
            msDesc = value
        End Set
    End Property

    Public Property ScanForSchemaChanges() As Boolean
        Get
            Return mbScanForSchemaChanges
        End Get
        Set(ByVal value As Boolean)
            mbScanForSchemaChanges = value
        End Set
    End Property

    Public Property IsActive() As Boolean
        Get
            Return mbIsActive
        End Get
        Set(ByVal value As Boolean)
            mbIsActive = value
        End Set
    End Property
#End Region

#Region "database"
    Public Sub Load()
        Dim oObject As New DBServer

        oObject.Load(Me)
    End Sub

    Public Sub Save()
        Dim oObject As New DBServer

        If mbObjectExists = True Then
            oObject.Update(Me)
        Else
            Me.CreateDate = Now
            oObject.Add(Me)
            mbObjectExists = True
        End If
    End Sub

    Private Sub DeleteAssociatedData()
        '---Tables
        Dim oTableFactory As New Table_Factory
        'oTableFactory.DeleteAllTablesForDatabase(mlID)

        '---Logins
        Dim oLoginFactory As New Login_Factory
        'oLoginFactory.DeleteAllLoginsForDatabase(mlID)

        '---Views
        Dim oViewFactory As New View_Factory
        'oViewFactory.DeleteAllViewsForDatabase(mlID)

        '---Procs
        Dim oProcFactory As New SProc_Factory
       ' oProcFactory.DeleteAllProcsForDatabase(mlID)

    End Sub

    Public Sub Delete()
        DeleteAssociatedData()

        Dim oObject As New DBServer

        oObject.Delete(Me)
        mbObjectExists = False
    End Sub
#End Region



End Class
